package com.snj.twelve;

import java.io.File;

public class ListDirectories {
    public static void main(String[] args) {
        String directoryPath = "D:\\0_莘纳吉\\慧能小电量\\1_报表替换文档备份";
        File directory = new File(directoryPath);

        if (directory.exists() && directory.isDirectory()) {
            File[] directories = directory.listFiles(File::isDirectory);
            if (directories != null) {
                for (File dir : directories) {
                    System.out.println(dir.getAbsolutePath());
                    System.out.println("test：" + dir.getName());
                }
            } else {
                System.out.println("No directories found.");
            }
        } else {
            System.out.println("specified path is invalid or not a directory.");
        }
    }
}